﻿using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Windows;
using Blackbird.Common.Properties;
using Blackbird.Core.Editable.Base;
using Blackbird.Studio.Mvvm;

namespace Blackbird.Studio.ViewModel.EntityViewModels
{
    public interface IEntityViewModel : INotifyPropertyChanged
    {
        string DisplayName { get; }
        bool IsSelected { get; }
        bool IsDirty { get; }
        EntityType EntityType { get; }        
        IEditableEntity Entity { get; }
        IEntityCollectionViewModel ParentViewModel { get; set; }
        
        Visibility AddChildCommandVisibility { get; }
        ObservableCollection<EntityCommandViewModel> RegisteredCommands { get; }
        Visibility NodeDisplayVisibility { get; }
        Visibility NodeEditorVisibility { get; }
        RelayCommand BeginRenameCommand { get; }
        RelayCommand EndRenameCommand { get; }
        RelayCommand DeleteCommand { get; }
    }

    public enum EntityType
    {
        Module,
        MapList,
        SpritePack,
        MultiSprite,
        FramesetList,
        Frameset,
        Frame,
        LayeredMap,
        MapLayer,
        MultiFrameMapNode,
        StaticMapNode
    }

    public static class EntityTypeExtension
    {
        public static string Description(this EntityType entityType)
        {
            return Resources.ResourceManager.GetString(string.Format("{0}Description", entityType));
        }
    }
}